<script setup>
import {ref} from "vue";
const $emits=defineEmits(['final'])

const $props=defineProps({
  time:{
    type:Number,
    default:60,
  },
})
const time=ref($props.time)
const timer=setInterval(()=>{
  time.value--
  if (time.value<=0){
    clearInterval(timer)
    $emits('final')
  }
},1000)

</script>

<template>
  <span>{{time}}秒后重试</span>
</template>

<style scoped lang="scss">

</style>
